<?php
// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );

global $my, $Itemid;
if ($my->gid){
	
$sql="SELECT a.referenceid, a.memberid, b.id, b.name AS displayname FROM #__comprofiler_members AS a, #__users AS b WHERE a.memberid=".$my->id." AND b.id=a.referenceid ORDER BY b.name";

$database->setQuery($sql);
$rows=$database->loadObjectList();	
$somanyfriends=count($rows);

foreach ($rows as $row)
{
	$mycons .= '<a href="index.php?option=com_comprofiler&amp;task=userProfile&amp;user='.$row->id.'">'.$row->displayname . '</a> | ';
	$mycons .= '<a href="index.php?option=com_uddeim&amp;task=new&amp;recip='.$row->id.'">PM</a> | ';
	$mycons .= '<a href="index.php?option=com_comprofiler&amp;task=emailUser&amp;user='.$row->id.'">e-mail</a><br />';
}	

if ($somanyfriends>0)
{
echo $mycons;
}
	
	
} else {
echo '<strong>' . _CONTACTO_USERMENU_PLEASE_REGISTER . '</strong>';
}
?>